<template>
  <div class="mybox">
    <div class="item_box">
      <div class="left_box"></div>
      <div class="right_box right">
        <div class="bg"></div>
        <div class="box_title">{{ onebox.field_name }}</div>
        <div class="value">
          <div class="box_value">{{ onebox.field_value }}</div>
          <div class="box_unit">{{ onebox.unit }}</div>
        </div>
      </div>
    </div>
    <div class="item_box">
      <div class="left_box bg1"></div>
      <div class="right_box right">
        <div class="bg"></div>
        <div class="box_title">{{ twobox.field_name }}</div>
        <div class="value ">
          <div class="box_value">{{ twobox.field_value }}</div>
          <div class="box_unit">{{ twobox.unit }}</div>
        </div>
      </div>
    </div>
    <div class="item_box">
      <div class="left_box bg2"></div>
      <div class="right_box right">
        <div class="bg"></div>
        <div class="box_title">{{ threebox.field_name }}</div>
        <div class="value newvalue">
          <div class="box_value">{{ threebox.field_value }}</div>
          <div class="box_unit">{{ threebox.unit }}</div>
        </div>
      </div>
    </div>
    <div class="item_box">
      <div class="left_box bg3"></div>
      <div class="right_box right">
        <div class="bg"></div>
        <div class="box_title">{{ fourbox.field_name }}</div>
        <div class="value">
          <div class="box_value">{{ fourbox.field_value }}</div>
          <div class="box_unit">{{ fourbox.unit }}</div>
        </div>
      </div>
    </div>
    <div class="item_box">
      <div class="left_box bg4"></div>
      <div class="right_box right">
        <div class="bg"></div>
        <div class="box_title">{{ fivebox.field_name }}</div>
        <div class="value newvalue">
          <div class="box_value">{{ fivebox.field_value }}</div>
          <div class="box_unit">{{ fivebox.unit }}</div>
        </div>
      </div>
    </div>
    <div class="item_box">
      <div class="left_box bg5"></div>
      <div class="right_box right">
        <div class="bg"></div>
        <div class="box_title">{{ sixbox.field_name }}</div>
        <div class="value newvalue">
          <div class="box_value">{{ sixbox.field_value }}</div>
          <div class="box_unit">{{ sixbox.unit }}</div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { getAction, postAction } from '@/api/manage'
export default {
  name: '',
  data () {
    return {
      onebox: {},
      twobox: {},
      threebox: {},
      fourbox: {},
      fivebox: {},
      sixbox: {}
    }
  },
  mounted () {
    this.initData()
  },
  methods: {
    initData () {
      postAction('/topic/data/listAllData/dy_dp_msjc_yanglao_gk', {}).then(res => {
        if (res.success) {
          this.onebox = res.result.data[0]
          this.twobox = res.result.data[1]
          this.threebox = res.result.data[2]
          this.fourbox = res.result.data[3]
          this.fivebox = res.result.data[4]
          this.sixbox = res.result.data[5]
        }
      })
    }
  }
}
</script>
<style lang="scss" scoped>
.mybox {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;

  .item_box {
    margin-bottom: 16px;
    display: flex;
    width: 210px;

    .left_box {
      margin-top: 10px;
      width: 80px;
      height: 54px;
      background: url('./img/111.png')no-repeat;
    }

    .bg1 {
      background: url('./img/22.png')no-repeat;
    }

    .bg2 {
      background: url('./img/33.png')no-repeat;
    }

    .bg3 {
      background: url('./img/44.png')no-repeat;
    }

    .bg4 {
      background: url('./img/55.png')no-repeat;
    }

    .bg5 {
      background: url('./img/66.png')no-repeat;
    }

    .right_box {
      position: relative;

      .box_title {
        font-family: Microsoft YaHei;
        font-weight: 400;
        font-size: 16px;
        color: #FFFFFF;
      }

      .box_value {
        font-family: Microsoft YaHei;
        font-weight: bold;
        font-size: 22px;
        color: #FFDE00;
      }

      .box_unit {
        font-family: Microsoft YaHei;
        font-weight: 400;
        font-size: 12px;
        color: #AEEDEC;
      }

      .bg {
        position: absolute;
        top: 10px;
        left: -10px;
        width: 121px;
        height: 13px;
        background: url('./img/5.png')no-repeat;
      }

      .value {
        display: flex;
        padding-top: 12px;

        .box_unit {
          margin-top: 10px;
          margin-left: 5px;
        }
      }

      .newvalue {
        padding-top: 0px;
      }
    }

    // .right {
    //   margin-top: 5px;
    // }

  }

}
</style>
